#include "map_minedatarender/MineTool.h"


namespace Mine
{
	void MineTool::setLayerShowStyle(CMineLayer* layer, ShowStyle style /*= ShowStyle::TEXTURE*/)
	{
		if (layer)
		{
			layer->setShowStyle(style);
		}
	}

	//bool MineTool::startClip(CMineLayer* layer, const osg::Plane& clipPlane)
	//{
	//	if (layer)
	//	{
	//		return layer->clip(clipPlane);
	//	}
	//	return false;
	//}

	bool MineTool::startClip(CMineLayer* layer, const osg::Vec3& startPt, const osg::Vec3& endPt)
	{
		if (layer)
		{
			std::vector<osg::Vec3> pts = { startPt, endPt };
			return layer->clip(pts);
		}
		return false;
	}

	bool MineTool::startClip(CMineLayer* layer, const std::vector<osg::Vec3>& pts)
	{
		if (layer)
		{
			return layer->clip(pts);
		}
		return false;
	}

	bool MineTool::stopClip(CMineLayer* layer)
	{
		if (layer)
		{
			return layer->clearClip();
		}
		return false;
	}
}